package metalink.staff;

import java.util.ArrayList;
import model.staff.DocumentMo;
import model.staff.FinanceMo;
import vo.DocumentListVo;
import com.opensymphony.xwork2.ActionSupport;

public class DeleteFile extends ActionSupport{
	int attachment_id;

	
	
	public int getAttachment_id() {
		return attachment_id;
	}



	public void setAttachment_id(int attachment_id) {
		this.attachment_id = attachment_id;
	}

	ArrayList<DocumentListVo> list = new ArrayList<DocumentListVo>();
	ArrayList<DocumentListVo> doclist = new ArrayList<DocumentListVo>();
	int course_professor_id;
	String id="";
	
	

	public String getId() {
		return id;
	}


	public void setId(String id) {
		this.id = id;
	}


	public ArrayList<DocumentListVo> getList() {
		return list;
	}


	public void setList(ArrayList<DocumentListVo> list) {
		this.list = list;
	}


	public ArrayList<DocumentListVo> getDoclist() {
		return doclist;
	}


	public void setDoclist(ArrayList<DocumentListVo> doclist) {
		this.doclist = doclist;
	}


	public int getCourse_professor_id() {
		return course_professor_id;
	}


	public void setCourse_professor_id(int course_professor_id) {
		this.course_professor_id = course_professor_id;
	}

	


	public String execute(){
		
		DocumentMo mo = new DocumentMo();
		try {
			int course_professor_id=Integer.parseInt(id);
			mo.DeleteDocument(attachment_id,Integer.parseInt(id));
			doclist=mo.getDocumentCourseDetails(course_professor_id);
			list=mo.getDocumentList(course_professor_id);
			
		} catch (Exception e) {
			addActionError(e.getMessage());
		}
		return SUCCESS;
	}
}
